*Note: This code estimates Models 2-5 reported in Tables A.5, A.7, A.9, A.11, A.13, A.15, A.17, and A.21 of 
	*the Supplemental Appendix. To do so, it reads-in the Stata .dta file "MonMalariaDataset.dta" and then 
	*prints relevant table output to screen.

*clear Stata
clear
clear matrix

*set memory
set more 1
set matsize 400
set mem 500m

*set working directory
cd  ""

*start log file
log using "Models_2_through_5_Tables_A5_A7_A9_A11_A13_A15_A17_A21", replace

*read-in monadic data
use "MonMalariaDataset.dta"

*xtset data
sort cowcode_2 year5
xtset cowcode_2 year5


*************************************************************************************
**Table A.5: Determinants of Monadic Diplomatic Representation, Main Specifications**
*************************************************************************************

*Pooled model
nbreg dr_1_at_2_m Lmalaria_interp_2_m Lcid_per_trop_2_m Llog_trade_m  Llog_gdppc_2_m Lln_cinc_2_m Ldemocracy_2_m Llog_distance_m t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12

*Pooled (clustered se's) model
nbreg dr_1_at_2_m Lmalaria_interp_2_m Lcid_per_trop_2_m Llog_trade_m  Llog_gdppc_2_m Lln_cinc_2_m Ldemocracy_2_m Llog_distance_m t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12, cluster(cowcode_2)

*Fixed effects model
xtnbreg dr_1_at_2_m Lmalaria_interp_2_m Llog_trade_m Llog_gdppc_2_m Lln_cinc_2_m Ldemocracy_2_m t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12, fe

*Random effects model
xtnbreg dr_1_at_2_m Lmalaria_interp_2_m Lcid_per_trop_2_m Llog_trade_m Llog_gdppc_2_m Lln_cinc_2_m Ldemocracy_2_m Llog_distance_m t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12, i(cowcode_2) 


***************************************************************************************
**Table A.7: Determinants of Monadic Diplomatic Representation, Non-Lagged Covariates**
***************************************************************************************

*Pooled model
nbreg dr_1_at_2_m malaria_interp_2_m cid_per_trop_2_m log_trade_m  log_gdppc_2_m ln_cinc_2_m democracy_2_m log_distance_m t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12

*Pooled (clustered se's) model
nbreg dr_1_at_2_m malaria_interp_2_m cid_per_trop_2_m log_trade_m  log_gdppc_2_m ln_cinc_2_m democracy_2_m log_distance_m t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12, cluster(cowcode_2)

*Fixed effects model
xtnbreg dr_1_at_2_m malaria_interp_2_m log_trade_m log_gdppc_2_m ln_cinc_2_m democracy_2_m t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12, fe

*Random effects model
xtnbreg dr_1_at_2_m malaria_interp_2_m cid_per_trop_2_m log_trade_m log_gdppc_2_m ln_cinc_2_m democracy_2_m log_distance_m t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12, i(cowcode_2) 


*************************************************************************************************
**Table A.9: Determinants of Monadic Diplomatic Representation, Non-Lagged Independent Variable**
*************************************************************************************************

*Pooled model
nbreg dr_1_at_2_m malaria_interp_2_m Lcid_per_trop_2_m Llog_trade_m  Llog_gdppc_2_m Lln_cinc_2_m Ldemocracy_2_m Llog_distance_m t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12

*Pooled (clustered se's) model
nbreg dr_1_at_2_m malaria_interp_2_m Lcid_per_trop_2_m Llog_trade_m  Llog_gdppc_2_m Lln_cinc_2_m Ldemocracy_2_m Llog_distance_m t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12, cluster(cowcode_2)

*Fixed effects model
xtnbreg dr_1_at_2_m malaria_interp_2_m Llog_trade_m Llog_gdppc_2_m Lln_cinc_2_m Ldemocracy_2_m t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12, fe

*Random effects model
xtnbreg dr_1_at_2_m malaria_interp_2_m Lcid_per_trop_2_m Llog_trade_m Llog_gdppc_2_m Lln_cinc_2_m Ldemocracy_2_m Llog_distance_m t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12, i(cowcode_2) 


******************************************************************************************************************
**Table A.11: Determinants of Monadic Diplomatic Representation, Omitting Non-Malarial Diplomatic Host Countries**
******************************************************************************************************************

*Pooled model
nbreg dr_1_at_2_m Lmalaria_interp_2_m Lcid_per_trop_2_m Llog_trade_m  Llog_gdppc_2_m Lln_cinc_2_m Ldemocracy_2_m Llog_distance_m t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 if Lmalaria_interp_2_m>0

*Pooled (clustered se's) model
nbreg dr_1_at_2_m Lmalaria_interp_2_m Lcid_per_trop_2_m Llog_trade_m  Llog_gdppc_2_m Lln_cinc_2_m Ldemocracy_2_m Llog_distance_m t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 if Lmalaria_interp_2_m>0, cluster(cowcode_2) 

*Fixed effects model
xtnbreg dr_1_at_2_m Lmalaria_interp_2_m Llog_trade_m Llog_gdppc_2_m Lln_cinc_2_m Ldemocracy_2_m t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 if Lmalaria_interp_2_m>0, fe

*Random effects model
xtnbreg dr_1_at_2_m Lmalaria_interp_2_m Lcid_per_trop_2_m Llog_trade_m Llog_gdppc_2_m Lln_cinc_2_m Ldemocracy_2_m Llog_distance_m t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 if Lmalaria_interp_2_m>0, i(cowcode_2) 


***************************************************************************************************
**Table A.13: Determinants of Monadic Diplomatic Representation, Non-Interpolated Malaria Measure**
***************************************************************************************************

*Pooled model
nbreg dr_1_at_2_m Lcid_malaria_2_m Lcid_per_trop_2_m Llog_trade_m  Llog_gdppc_2_m Lln_cinc_2_m Ldemocracy_2_m Llog_distance_m t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12

*Pooled model
nbreg dr_1_at_2_m Lcid_malaria_2_m Lcid_per_trop_2_m Llog_trade_m  Llog_gdppc_2_m Lln_cinc_2_m Ldemocracy_2_m Llog_distance_m t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12, cluster(cowcode_2)

*Fixed effects model
xtnbreg dr_1_at_2_m Lcid_malaria_2_m Llog_trade_m Llog_gdppc_2_m Lln_cinc_2_m Ldemocracy_2_m t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12, fe

*Random effects model
xtnbreg dr_1_at_2_m Lcid_malaria_2_m Lcid_per_trop_2_m Llog_trade_m Llog_gdppc_2_m Lln_cinc_2_m Ldemocracy_2_m Llog_distance_m t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12, i(cowcode_2) 


***************************************************************************************************
**Table A.15: Determinants of Monadic Diplomatic Representation, Population-Based Malaria Measure**
***************************************************************************************************

*Pooled model
nbreg dr_1_at_2_m Lmalaria_interp_pop_2_m Lcid_per_trop_2_m Llog_trade_m  Llog_gdppc_2_m Lln_cinc_2_m Ldemocracy_2_m Llog_distance_m t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12

*Pooled (clustered se's) model
nbreg dr_1_at_2_m Lmalaria_interp_pop_2_m Lcid_per_trop_2_m Llog_trade_m  Llog_gdppc_2_m Lln_cinc_2_m Ldemocracy_2_m Llog_distance_m t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12, cluster(cowcode_2)

*Fixed effects model
xtnbreg dr_1_at_2_m Lmalaria_interp_pop_2_m Llog_trade_m Llog_gdppc_2_m Lln_cinc_2_m Ldemocracy_2_m t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12, fe

*Random effects model
xtnbreg dr_1_at_2_m Lmalaria_interp_pop_2_m Lcid_per_trop_2_m Llog_trade_m Llog_gdppc_2_m Lln_cinc_2_m Ldemocracy_2_m Llog_distance_m t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12, i(cowcode_2) 


************************************************************************************************************
**Table A.17: Determinants of Monadic Diplomatic Representation, Combined Endemic Disease Exposure Measure**
************************************************************************************************************

*Pooled model
nbreg dr_1_at_2_m L_total_exposure_2  Lcid_per_trop_2_m Llog_trade_m  Llog_gdppc_2_m Lln_cinc_2_m Ldemocracy_2_m Llog_distance_m  t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12

*Pooled (clustered se's) model
nbreg dr_1_at_2_m L_total_exposure_2  Lcid_per_trop_2_m Llog_trade_m  Llog_gdppc_2_m Lln_cinc_2_m Ldemocracy_2_m Llog_distance_m  t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12, cluster(cowcode_2)

*Fixed effects model
xtnbreg dr_1_at_2_m L_total_exposure_2  Llog_trade_m Llog_gdppc_2_m Lln_cinc_2_m Ldemocracy_2_m  t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12, fe

*Random effects model
xtnbreg dr_1_at_2_m L_total_exposure_2 Lcid_per_trop_2_m Llog_trade_m Llog_gdppc_2_m Lln_cinc_2_m Ldemocracy_2_m Llog_distance_m  t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12, i(cowcode_2) 


*******************************************************************************************
**Table A.21: Determinants of Directed Diplomatic Representation, Expanded Control Models**
*******************************************************************************************

*Pooled model
nbreg dr_1_at_2_m Lmalaria_interp_2_m Lcid_per_trop_2_m Llog_trade_m  Llog_gdppc_2_m Lln_cinc_2_m Ldemocracy_2_m Llog_distance_m Linternal_conf_2_m Lexternal_conf_2_m  Lln_irst_2_m Lln_milex_2_m Lln_milper_2_m Lln_pec_2_m Lln_upop_2_m entryy_2_m t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12

* Pooled (clustered se's) model
nbreg dr_1_at_2_m Lmalaria_interp_2_m Lcid_per_trop_2_m Llog_trade_m  Llog_gdppc_2_m Lln_cinc_2_m Ldemocracy_2_m Llog_distance_m Linternal_conf_2_m Lexternal_conf_2_m  Lln_irst_2_m Lln_milex_2_m Lln_milper_2_m Lln_pec_2_m Lln_upop_2_m entryy_2_m t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12, cluster(cowcode_2)

*Fixed effects model
xtnbreg dr_1_at_2_m Lmalaria_interp_2_m Llog_trade_m Llog_gdppc_2_m Lln_cinc_2_m Ldemocracy_2_m Linternal_conf_2_m Lexternal_conf_2_m  Lln_irst_2_m Lln_milex_2_m Lln_milper_2_m Lln_pec_2_m Lln_upop_2_m entryy_2_m t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12, fe

*Random effects model
xtnbreg dr_1_at_2_m Lmalaria_interp_2_m Lcid_per_trop_2_m Llog_trade_m Llog_gdppc_2_m Lln_cinc_2_m Ldemocracy_2_m Llog_distance_m Linternal_conf_2_m Lexternal_conf_2_m  Lln_irst_2_m Lln_milex_2_m Lln_milper_2_m Lln_pec_2_m Lln_upop_2_m entryy_2_m t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12, i(cowcode_2) 

*close log file
log close

